package com.wis;

import com.wis.entity.AdminEntity;
import com.wis.entity.BannerEntity;
import com.wis.mapper.BannerMapper;
import com.wis.mapper.NoticeMapper;
import com.wis.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest
public class LoginTest {
    @Autowired
    private AdminService adminService;
    @Autowired
    private BannerMapper bannerMapper;
    @Autowired
    private NoticeMapper noticeMapper;
    /**
     * 登录测试
     * **/
    @Test
    public void loginTest(){
        log.info("loginTest",adminService.selectAdmin(new AdminEntity(1,"123","123")));
    }

    /**
     * 插入轮播图测试
     * **/
    @Test
    public void insertBannerTest(){
        log.info("insertBannerTest",bannerMapper.addBanner(new BannerEntity(null,"轮播图插入测试","/img/1.jpg",1)));
    }

    /**
     * 修改轮播图测试
     * **/
    @Test
    public void updateBannerTest(){
        log.info("updateBannerTest",bannerMapper.updateBanner(new BannerEntity(1,"1","/images/1.jpg",1)));
    }

    /**
     * 删除轮播图测试
     * **/
    @Test
    public void delBannerTest(){
        log.info("delBannerTest",bannerMapper.delBanner(6));
    }
    /**
     * 模糊查询公告测试
     * **/
    @Test
    public void findBlurryTest(){
        log.info("findBlurryTest",noticeMapper.findBlurry("1"));
    }
}
